﻿
namespace n_ForeverIns
{
using System;
using System.Drawing;
using System.Drawing.Drawing2D;

using n_MyIns;
using n_Shape;
using n_EXP;
using n_GUIset;
using n_CondiEndIns;

//*****************************************************
//逻辑流程组件类
public class ForeverIns: MyIns
{
	//const int W = 49;
	const int W = 70;
	
	public CondiEndIns InsEnd;
	
	//构造函数
	public ForeverIns(): base()
	{
		this.Width = W;
		this.Height = GUIset.ExpFont.Height + 4;
	}
	
	//设置用户参数
	public void SetUserValue( string vName, string vGroupMes, int vX, int vY, int vAngle )
	{
		Name = vName;
		GroupMes = vGroupMes;
		SX = vX;
		SY = vY;
	}
	
	public override void UserMouseClick( int mX, int mY )
	{
		
	}
	
	public override void UserMouseMove( bool isMouseOn, int mX, int mY )
	{
		
	}
	
	//组件绘制工作1
	//绘制组件的外形等,基础绘制工作
	public override void Draw1( Graphics g )
	{
		if( isNewTick != 0 ) {
			return;
		}
		
		Brush b = FlowBackColor;
		if( isNote ) {
			b = NoteColor;
		}
		
		//绘制竖直连线
		g.FillRectangle( b, SX, SY + LineOffset, 5, this.InsEnd.SY - this.SY );
		//g.FillRectangle( Brushes.Orange, StartX + SX, StartY + SY + 3, 5, this.InsEnd.SY - this.SY );
		
		//绘制组件名称
		Rectangle r = new Rectangle( SX, SY + HeadRectYOffset, W, GUIset.ExpFont.Height + 4 );
		//g.DrawRectangle( Pens.White, r );
		GraphicsPath gp = Shape.CreateRoundedRectanglePath( r );
		g.FillPath( b, gp );
		//g.DrawPath( Pens.Orange, gp );
		g.DrawString( n_Language.Language.Forever, GUIset.ExpFont, FlowForeColor, SX + 3, SY + HeadStringYOffset );
	}
}
}


